import useStore from '@/store/index';
import { createRouter, createWebHashHistory } from 'vue-router';

import routes from '~pages';
const router = createRouter({
  history: createWebHashHistory(),
  routes
})


router.beforeEach((to, from, next) => {
  //let store = useStore();
  //store.setApi(to.meta.api);
  /* let login = "/login"
  if (store.loginFlag) {
    if (to.path == login) {
      next("/")
    } else {
      next();
    }
  } else if (to.path == login) { */
  next();
  /* } else {
    next(login);
  } */

});
export default router;
